package com.sujetExercice.nitrox;

import java.io.Serializable;

import com.sujetExercice.util.MathUtil;



public class PressionPartielle implements Serializable{


	private static final long serialVersionUID = -3877739897710820376L;
	
	private double pourcentageOxy = 21;
	private double ppo2max = 1.6;
	private double ppo2fede = 1.4;
	private double pression = 0;

	/*
	 * CONSTRUCTOR
	 */
	
	public PressionPartielle(double prc,double pr){		
		pourcentageOxy = prc;	
		pression = pr;
	}
	
	public PressionPartielle(int prc,int pr){		
		pourcentageOxy = prc;	
		pression = pr;
	}
	
	/*
	 * CALCUL
	 */
	
	/**
	 * 
	 */
	public void calculPressionAvecPpO2Max(){
		String arr = MathUtil.get().arrondirDeuxChiffre(pourcentageOxy/100);		
		pression = (ppo2max/Double.parseDouble(arr));		
		String press = MathUtil.get().arrondirDeuxChiffre(pression);
		pression = Double.parseDouble(press);
	}
	
	/**
	 * 
	 */
	public void calculPressionAvecPpO2Fede(){		
		String arr = MathUtil.get().arrondirDeuxChiffre(pourcentageOxy/100);		
		pression = (ppo2fede/Double.parseDouble(arr));		
		String press = MathUtil.get().arrondirDeuxChiffre(pression);
		pression = Double.parseDouble(press);
	}

	/*
	 * GETTER & SETTER
	 */
	public double getPourcentageOxy() {
		return pourcentageOxy;
	}

	public void setPourcentageOxy(double pourcentageOxy) {
		this.pourcentageOxy = pourcentageOxy;
	}

	public double getPpo2max() {
		return ppo2max;
	}

	public void setPpo2max(double ppo2max) {
		this.ppo2max = ppo2max;
	}

	public double getPpo2fede() {
		return ppo2fede;
	}

	public void setPpo2fede(double ppo2fede) {
		this.ppo2fede = ppo2fede;
	}

	public double getPression() {
		return pression;
	}

	public void setPression(double pression) {
		this.pression = pression;
	}
	
	
	
	
}
